package com.cr.observer.improve;

public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();

        CurrentConditions currentConditions = new CurrentConditions();

        weatherData.registerObserver(currentConditions);

        SinaSit sinaSit = new SinaSit();

        weatherData.registerObserver(sinaSit);
        System.out.println(" ==================天气更新=================== ");
        weatherData.setData(30, 150, 40);

        System.out.println(" ==================天气更新，移除新浪=================== ");
        weatherData.removeObserver(sinaSit);
        weatherData.setData(20, 150, 50);
    }
}
